package com.aat.dxfy.rmi.demo1;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import java.util.Map;

public class WarehouseImpl extends UnicastRemoteObject implements Warehouse {

	private static final long serialVersionUID = 1L;

	private Map<String, Double> prices;

	protected WarehouseImpl() throws RemoteException {
		super();
		prices = new HashMap<String, Double>();
		prices.put("aa", 699.00);
		prices.put("bb", 899.00);
	}

	@Override
	public double getPrice(String desc) throws RemoteException {
		Double price = prices.get(desc);
		return price == null ? 0 : price;
	}

}
